import unittest
import requests


class MyTestCase(unittest.TestCase):
    def test_something(self):
        vdata = {"username":"sang","password":123}
        head = {"Content-Type":"application/x-www-form-urlencoded"}
        cc = requests.post("http://182.92.178.83:8081/login",data=vdata,headers=head,timeout=2)
        v = cc.json()
        # self.assertEqual(True, False)  # add assertion here
        if cc.status_code==200:
            self.assertEqual(v['msg'],'登录成功')
        else:
            pass


if __name__ == '__main__':
    unittest.main()
